package cn.enilu.flash.bean.entity.bus;

import cn.enilu.flash.bean.entity.BaseEntity;
import cn.enilu.flash.bean.entity.cms.Article;
import cn.enilu.flash.bean.entity.shop.ShopUser;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

@Entity(name="t_bus_action_attend")
@Table(appliesTo = "t_bus_action_attend",comment = "活动参与表")
@Data
@EntityListeners(AuditingEntityListener.class)
public class ActionAttend extends BaseEntity {

    @Column(name="user_id",columnDefinition = "BIGINT COMMENT '预约用户id'")
    private Long userId;

    @JoinColumn(name="user_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @ManyToOne(fetch = FetchType.LAZY)
    private ShopUser user;

    @Column(name="action_id",columnDefinition = "BIGINT COMMENT '活动id'")
    private Long actionId;

    @JoinColumn(name="action_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @ManyToOne(fetch = FetchType.LAZY)
    private Article article;


}
